const session = require("express-session");
const { SESSION_SECRET } = require("../../config");

module.exports = (app) => {
    app.use(
        session({
            name: "user",
            secret: SESSION_SECRET,
            resave: false,
            saveUninitialized: false,
            rolling: true,
            cookie: {
                maxAge: 1000 * 60 * 60 * 24,
                httpOnly: true,
                secure: false
            }
        })
    );
};
